#!/bin/sh

for FILE in UI*.png; do
    if [ $(identify "$FILE" | grep -c "PNG 800x600") = 1 ]; then
        export HEIGHT=$(identify -verbose "$FILE" | grep "Note:" | cut -c 11-)
        
        convert -trim -resize 800x$HEIGHT "$FILE" "$FILE"
        
        if [ $(echo "$FILE" | grep -c "UI Icon") = 1 ]; then
            convert -border 1x1 -bordercolor transparent "$FILE" "$FILE"
        fi
    fi
done

svn add *.png
svn add ../Models/*.blend
svn propset svn:mime-type "image/png" *.png

